﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AD.Model;

/// <summary>
///WebManagerForm 的摘要说明
/// </summary>
public class WebManagerForm : WebForm
{
    protected override void OnInit(EventArgs e)
    {
        string applicationPath = base.Request.ApplicationPath;
        if (!applicationPath.EndsWith("/"))
        {
            applicationPath = applicationPath + "/";
        }
        //登陆继续往下执行
        //if (this.Session[UtilHepler.SESSION_NAME] == null)
        if (UtilHepler.GetMangerClientCookies(Request, Response) == null)
        {
            string str2 = base.Request.RawUrl.ToString();
            //RedirectNewURL(string.Format("{0}Manager/User/index.html?url={1}", applicationPath, str2));
            RedirectNewRedirectMethodURL(string.Format("{0}Manager/User/index.html?url={1}", applicationPath, str2));
            //RedirectNewRedirectMethodURL(string.Format("index.html?url={1}", applicationPath, str2));
            base.Response.End();
        }
        base.OnInit(e);
    }

    public string GetKeyWordsStatus(KeyWordsStatus status)
    {
        if (status == KeyWordsStatus.Pass)
            return "通过";
        else if (status == KeyWordsStatus.WaitPass)
            return "待审核";
        else
            return "不通过";
    }
    public string GetSearchEngineType(SearchEngineType searchEngineType)
    {
        if (searchEngineType == SearchEngineType.Google)
        {
            return "谷歌";
        }
        else if (searchEngineType == SearchEngineType.Sogo)
        {
            return "搜狗";
        }
        else
        {
            return "百度";
        }
    }
    public string GetShopType(int shopType)
    {
        if (shopType == 1)
        {
            return "淘宝";
        }
        else
        {
            return "拍拍";
        }
    }
    public string GetShopType(ShopType shopType)
    {
        if (shopType == ShopType.Taobao)
        {
            return "淘宝";
        }
        else
        {
            return "拍拍";
        }
    }
    public string GetReverseStatus(KeyWordsStatus status)
    {
        if (status == KeyWordsStatus.Pass)
            return "撤销";
        else
            return "通过";
        
    }
}